﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <Style x:Key="ListScrollViewerStyle"
           TargetType="{x:Type ScrollViewer}">
        <Setter Property="OverridesDefaultStyle"
                Value="True" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ScrollViewer}">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition />
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>
                        <Border x:Name="border"
                                Grid.Row="0"
                                Grid.Column="0"
                                BorderBrush="#a7a9ac"
                                BorderThickness="0">
                            <ScrollContentPresenter />
                        </Border>
                        <ScrollBar x:Name="PART_VerticalScrollBar"
                                   Grid.Row="0"
                                   Grid.Column="1"
                                   Value="{TemplateBinding VerticalOffset}"
                                   Maximum="{TemplateBinding ScrollableHeight}"
                                   ViewportSize="{TemplateBinding ViewportHeight}"
                                   Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" />
                        <Rectangle Grid.Row="1"
                                   Grid.Column="0"
                                   Height="{Binding ElementName=PART_HorizontalScrollBar, Path=Height}"
                                   Margin="{Binding ElementName=PART_HorizontalScrollBar, Path=Margin}" />
                        <ScrollBar x:Name="PART_HorizontalScrollBar"
                                   Grid.Row="1"
                                   Grid.Column="0"
                                   Orientation="Horizontal"
                                   Value="{TemplateBinding HorizontalOffset}"
                                   Maximum="{TemplateBinding ScrollableWidth}"
                                   ViewportSize="{TemplateBinding ViewportWidth}"
                                   Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" />
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger SourceName="PART_VerticalScrollBar"
                                 Property="Visibility"
                                 Value="Collapsed">
                            <Setter TargetName="border"
                                    Property="BorderThickness"
                                    Value="0 0 1 0" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>